package com.aistar.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * @ClassName: LoginController
 * @author: LiuWenXiu
 * @date: 2021/10/16 9:20
 * @Description: TODO...本类用来演示:
 */
@Controller
@RequestMapping("/login")
public class LoginController {

    @GetMapping()
    public String login() {
        return "/html/view/user/login.html";
    }


    @GetMapping("/export")
    public String exit(HttpServletRequest request) {
        // ToDo... 清除session
        HttpSession session = request.getSession();
        session.invalidate();

//        System.out.println("调用啦!");
        // 清除token
        return "/html/view/user/login.html";
    }
}
